"""empty message

Revision ID: 006fd85f8b9c
Revises: 9376447014b6
Create Date: 2023-11-23 21:58:16.955257

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision: str = '006fd85f8b9c'
down_revision: Union[str, None] = '9376447014b6'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('dname', table_name='t_dept')
    op.drop_table('t_dept')
    op.drop_column('t_emp', 'dept_id')
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('t_emp', sa.Column('dept_id', mysql.INTEGER(), autoincrement=False, nullable=False))
    op.create_table('t_dept',
    sa.Column('id', mysql.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('dname', mysql.VARCHAR(length=20), nullable=False),
    sa.Column('city', mysql.VARCHAR(length=50), nullable=False),
    sa.Column('create_time', mysql.DATETIME(), nullable=False, comment='记录的创建时间'),
    sa.Column('update_time', mysql.DATETIME(), nullable=False, comment='记录的最后一次修改时间'),
    sa.PrimaryKeyConstraint('id'),
    mysql_collate='utf8mb4_0900_ai_ci',
    mysql_default_charset='utf8mb4',
    mysql_engine='InnoDB'
    )
    op.create_index('dname', 't_dept', ['dname'], unique=False)
    # ### end Alembic commands ###
